#!/bin/bash

VERSION_FILE="fota.ver"
OLD_VERSION=$(cat $VERSION_FILE)
NEW_VERSION=v$(date +%Y%m%d.%H%M)
echo $NEW_VERSION > $VERSION_FILE
echo " ==> old version: "$OLD_VERSION
echo " ==> new version: "$NEW_VERSION


cp Dockerfile_fota Dockerfile
docker build -t a80:5000/isee-fota:$NEW_VERSION .
docker push a80:5000/isee-fota:$NEW_VERSION

cd /var/k8s/bin/
./deploy.sh isee-fota $NEW_VERSION $OLD_VERSION

